package br.com.vfsb.dao;

import org.hibernate.Session;
import org.hibernate.Transaction;

import br.com.vfsb.entity.VendasLocais;
import br.com.vfsb.util.HibernateUtil;

public class ComprasLocaisBiDAO {

	public void salvar(VendasLocais c){

		Session session = HibernateUtil.getSessionFactory().openSession();
		Transaction tx = null;
		try {

			tx = session.beginTransaction();
			session.save(c);
			tx.commit();
			//session.close();

		} catch (RuntimeException e) {
			if(tx != null){
			tx.rollback();
			session.close();
			}
			
		}finally{
			session.close();
		}
	}
	
}
